package cn.wolfcode.trip.base.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;
@Setter
@Getter
public class Collect extends BaseDomain{
    public static final int TYPE_TRAVEL= 1;//游记

    public static final int TYPE_STRATEGY = 2;//攻略

    public static final int TYPE_DAILY = 3;//日报


    public static final int STATE_CANCEL = 0;//取消收藏

    public static final int STATE_SELECT = 1;//收藏


    /**
     * 收藏内容id
     */
    private  Long collectId;
    /**
     * 内容对象类型
     */
    private Integer type = TYPE_TRAVEL ;//默认为游记对象
    /**
     * 收藏状态
     */
    private Integer state = STATE_SELECT;//默认为收藏
    /**
     * 收藏时间
     */
    private Date collectTime;
    /**
     * 用户id
     */
    private User user;


    public String getTypeName() {
        if (type == TYPE_TRAVEL) {
            return "游记";
        } else if (type == TYPE_STRATEGY) {
            return "攻略";
        } else {
            return "日报";
        }
    }
}